import request from '@/utils/request'

// 创建应急预案
export function createEmergencyReservePlan(data) {
  return request({
    url: '/biz/emergency-reserve-plan/create',
    method: 'post',
    data: data
  })
}

// 更新应急预案
export function updateEmergencyReservePlan(data) {
  return request({
    url: '/biz/emergency-reserve-plan/update',
    method: 'put',
    data: data
  })
}

// 删除应急预案
export function deleteEmergencyReservePlan(id) {
  return request({
    url: '/biz/emergency-reserve-plan/delete?id=' + id,
    method: 'delete'
  })
}

// 获得应急预案
export function getEmergencyReservePlan(id) {
  return request({
    url: '/biz/emergency-reserve-plan/get?id=' + id,
    method: 'get'
  })
}

// 获得应急预案分页
export function getEmergencyReservePlanPage(query) {
  return request({
    url: '/biz/emergency-reserve-plan/page',
    method: 'get',
    params: query
  })
}

// 导出应急预案 Excel
export function exportEmergencyReservePlanExcel(query) {
  return request({
    url: '/biz/emergency-reserve-plan/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
